package com.test.action;

import java.util.List;

import com.test.dao.ILoginDao;

public class LoginAction {

	
		private ILoginDao loginDao;
		private String username;
		private String password;
		

		public String getUsername() {
			return username;
		}
		public void setUsername(String username) {
			this.username = username;
		}
		public String getPassword() {
			return password;
		}
		public void setPassword(String password) {
			this.password = password;
		}
		
		public ILoginDao getLoginDao() {
			return loginDao;
		}
		public void setLoginDao(ILoginDao loginDao) {
			this.loginDao = loginDao;
		}
		
		public String execute(){
			String username = getUsername();
			String password = getPassword();
			System.out.println("userName:"+username+"\n"+"password:"+password);
			List<String> list = loginDao.getUser(username);
			if(list.size()>0){
				return "success";
			}else{
				return "error";
			}
			
		}
		
}
